package com.example.demo.service.impl;

import com.example.demo.dao.PersonRepository;
import com.example.demo.model.Person;
import com.example.demo.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @author hankChan
 *         25/10/2017.
 */
@Service
public class PersonServiceImpl implements PersonService {

    @Autowired
    @Qualifier("personRepository")
    PersonRepository personRepository;

    @Override
    public Person getPersonByName(String name) {
        return personRepository.findOneByName(name);
    }
}
